## Drawing Fig8(f)
import matplotlib.pyplot as plt
from matplotlib import rcParams

plt.rcParams['figure.dpi'] = 1200
fr = open("DrawingFig8(e)(f).csv", "r")
ls = []
for line in fr:
    line = line.replace("\n","")
    ls.append(line.split(","))
fr.close()

x_start = -300.0
x_end = 5300.0
y_start = 0.0
y_end = 0.23
x1, x2, x3 = [], [], []
y4, y5, y6 = [], [], []
iLen, jLen = len(ls), len(ls[0])
for i in range(1, iLen):
    if int(ls[i][0]) == 10:
        x1.append(float(ls[i][1]))
        y4.append(float(ls[i][6]))
    elif int(ls[i][0]) == 20:
        x2.append(float(ls[i][1]))
        y5.append(float(ls[i][6]))
    elif int(ls[i][0]) == 30:
        x3.append(float(ls[i][1]))
        y6.append(float(ls[i][6]))

plt.figure(figsize=(6.0, 4.0))
plt.xlim(x_start-0.01, x_end+0.01)
plt.ylim(y_start-0.005, y_end+0.005)
plt.xticks([0, 1000, 2000, 3000, 4000, 5000], ['0', '1000', '2000', '3000', '4000', '5000'])
plt.plot(x1, y4, "r.-", label="$r = 10$", linewidth=1)
plt.plot(x2, y5, "g.-", label="$r = 20$", linewidth=1)
plt.plot(x3, y6, "b.-", label="$r = 30$", linewidth=1)
plt.xlabel('$L$')
plt.ylabel('$Std$')
plt.legend()

plt.savefig("Fig8(f).jpg")
plt.show()
